---
title: 'Facebook'
sidebarTitle: 'Facebook'
description: 'Access the Facebook API in 2 minutes 💨'
---

import { StatusWidget } from "/snippets/api-down-watch/status-widget.jsx"

<StatusWidget service="facebook" />

<Tabs>
  <Tab title="🚀 Quickstart">
    <Steps>
      <Step title="Create an integration">
        In Nango ([free signup](https://app.nango.dev)), go to [Integrations](https://app.nango.dev/dev/integrations) -> _Configure New Integration_ -> _Facebook_.
      </Step>
      <Step title="Authorize Facebook">
        Go to [Connections](https://app.nango.dev/dev/connections) -> _Add Test Connection_ -> _Authorize_, then log in to Facebook. Later, you'll let your users do the same directly from your app.
      </Step>
      <Step title="Call the Facebook API">
        Let's make your first request to the Facebook API (fetch authenticated user profile information). Replace the placeholders below with your [secret key](https://app.nango.dev/dev/environment-settings), [integration ID](https://app.nango.dev/dev/integrations), and [connection ID](https://app.nango.dev/dev/connections):
        <Tabs>
            <Tab title="cURL">

                ```bash
                curl "https://api.nango.dev/proxy/me?fields=id,name,email" \
                  -H "Authorization: Bearer <NANGO-SECRET-KEY>" \
                  -H "Provider-Config-Key: <INTEGRATION-ID>" \
                  -H "Connection-Id: <CONNECTION-ID>"
                ```

            </Tab>

            <Tab title="Node">

            Install Nango's backend SDK with `npm i @nangohq/node`. Then run:

            ```typescript
            import { Nango } from '@nangohq/node';

            const nango = new Nango({ secretKey: '<NANGO-SECRET-KEY>' });

            const res = await nango.get({
                endpoint: '/me',
                params: {
                  fields: 'id,name,email'
                },
                providerConfigKey: '<INTEGRATION-ID>',
                connectionId: '<CONNECTION-ID>'
            });

            console.log(res.data);
            ```
            </Tab>

        </Tabs>

        Or fetch credentials dynamically via the [Node SDK](/reference/sdks/node#get-a-connection-with-credentials) or [API](/reference/api/connection/get).

      </Step>
    </Steps>

    ✅ You're connected! Check the [Logs](https://app.nango.dev/dev/logs) tab in Nango to inspect requests.

    <Tip>
    Next step: [Embed the auth flow](/getting-started/quickstart/embed-in-your-app) in your app to let your users connect their Facebook accounts.
    </Tip>
  </Tab>
  <Tab title="🧑‍💻 OAuth app setup">
    <Steps>
      <Step title="Create a Facebook Developer account">
        If you don't already have one, go to [Meta for Developers](https://developers.facebook.com/) and create a developer account.
      </Step>
        <Step title="Create a new app">
          1. Go to the [Meta Developer Dashboard](https://developers.facebook.com/apps/).
          2. Click **Create App**, enter your **App name** then click **Next**.
          3. Select the appropriate **Use cases** then click **Next**.
          4. Select which Business portfolio you want to associate with the app, then click **Next**.
          5. Review the **Publishing requirements**, then click **Next** if you agree. Finally, click **Go to dashboard** to complete the setup.
        </Step>
      <Step title="Configure OAuth settings">
        1. In the left sidebar, navigate to **Facebook Login for Business** > **Settings**.
        2. In **Valid OAuth Redirect URIs**, add: `https://api.nango.dev/oauth/callback`, leave the other fields default.
        3. Click **Save Changes**.
      </Step>
      <Step title="Add Platform">
        1. Go to **App Settings** > **Basic** in the left sidebar.
        2. Click **Add Platform** > **Website**.
        3. Enter the site URL (e.g. `https://api.nango.dev/`).
      </Step>
      <Step title="Obtain your App credentials">
        1. Go to **App Settings** > **Basic** in the left sidebar.
        2. Copy your **App ID** this is your **Client ID** and **App Secret** which is your **Client Secret**, you’ll need these credentials when configuring your integration in Nango.
      </Step>
      <Step title="Configure permissions">
        1. In the left sidebar, navigate to **Use cases**.
        2. Find your use case and click **Customize** to configure permissions and features.
        3. In the **Permissions** section, you'll see `public_profile` is automatically added.
        4. Click **Add** for additional [permissions](https://developers.facebook.com/docs/development/create-an-app/use-cases-permission-mapping) needed for your app.
        <Note> Some [permissions](https://developers.facebook.com/docs/facebook-login/guides/permissions/review) may require App Review before going live</Note>
      </Step>
      <Step title="Next">
        Follow the [_Quickstart_](/getting-started/quickstart).
      </Step>
    </Steps>

    <Note>Contribute improvements to the setup guide by [editing this page](https://github.com/nangohq/nango/tree/master/docs/integrations/all/facebook.mdx)</Note>
  </Tab>
  <Tab title="🔗 Useful links">
    | Topic | Links |
    | - | - |
    | General | [Meta for Developers](https://developers.facebook.com/) |
    | | [Meta Developer Dashboard](https://developers.facebook.com/apps/) |
    | Developer | [API documentation](https://developers.facebook.com/docs/) |
    | | [How to create an Application](https://developers.facebook.com/docs/development/create-an-app/) |
    | | [OAuth documentation](https://developers.facebook.com/docs/facebook-login/guides/advanced/manual-flow#confirm) |
    | | [List of OAuth scopes](https://developers.facebook.com/docs/permissions/reference) |
    | | [Use Case Permission Mapping](https://developers.facebook.com/docs/development/create-an-app/use-cases-permission-mapping) |

    <Note>Contribute useful links by [editing this page](https://github.com/nangohq/nango/tree/master/docs/integrations/all/facebook.mdx)</Note>
  </Tab>
  <Tab title="🚨 API gotchas">
    _No reported gotchas._

    <Note>Contribute API gotchas by [editing this page](https://github.com/nangohq/nango/tree/master/docs/integrations/all/facebook.mdx)</Note>
  </Tab>
</Tabs>

<Info>
    Questions? Join us in the [Slack community](https://nango.dev/slack).
</Info>
